<?php
include "conn.php";
$id = $_GET['id'];
$data = showBlogById($id);
?>

<!doctype html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>编辑博客</title>
</head>
<body>

<div class="form-container">
    <form method="post" action="updateBlog.php?id=<?php echo $id ?>">
        <div class="ta-container">
            <label for="title">标题</label>
            <input type="text" id="title" name="title" value="<?php echo $data['title'] ?>">
            <label for="author">作者</label>
            <input type="text" id="author" name="author" value="<?php echo $data['author'] ?>">
        </div>
        <div class="content-container">
            <label for="content">内容</label>
            <textarea name="content" id="content" cols="53" rows="10">
                <?php echo $data['content'] ?>
            </textarea>
        </div>
        <div>
            <input type="submit" value="提交">
        </div>
    </form>
</div>
</body>
</html>

<style>
    .form-container {
        display: flex;
        justify-content: center;
    }

    .ta-container {
        margin-bottom: 5px;
    }

    .content-container {
        margin-bottom: 5px;
    }
</style>
